pub use self::room::{ChessRoom, GameStage};
pub use self::player::ChessPlayer;
pub use self::chessboard::{Chessboard, ChessPiece, ChessPoint, Point};

mod chessboard;
mod player;
mod room;
mod board;

///棋子颜色
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum PieceColor{
    Black,
    White
}

///下棋行动结果
pub enum ChessResult{
    Ok,
    Error(u16, String)
}

#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ChessAction{
    ///玩家落子。 player_id, location
    PutPiece(u8),

    ///玩家吃子。 player_id, location
    KillPiece(u8),

    ///玩家走子。 user_id, source, target
    MovePiece(u8, u8),

    ///玩家投降。 user_id
    GiveUp(),

    ///玩家失去连接
    LoseConnection()
}